package com.tc.modules.sys.api;

import com.tc.common.http.abs.BaseHttp;
import com.tc.common.http.result.HttpResult;
import com.tc.model.dto.SysUserInfoDto;
import com.tc.modules.sys.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: tianchao
 * @Date: 2020/4/25 09:59
 * @Description: 用户表 api
 */
@Slf4j
@RestController
@RequestMapping("/sys/user")
public class SysUserApi extends BaseHttp {
    @Autowired
    private ISysUserService service;

    /**
     * 根据用户登陆名称获取用户信息
     * @return userinfo
     */
    @GetMapping(value = "/info")
    public HttpResult<SysUserInfoDto> getCurrentUserInfo(){
        return new HttpResult<SysUserInfoDto>(service.getCurrentUserInfo());
    }
}
